package com.it.dao.factory;

import com.it.dao.UserDao;
import com.it.dao.impl.UserDaoImpl;
import org.springframework.beans.factory.FactoryBean;

public class UserDaoFactoryBean implements FactoryBean<UserDao> {
    //代替原始实例工厂中创建对象的方法

    // bean实例
    public UserDao getObject() throws Exception {
        return new UserDaoImpl();
    }

    // bean类型
    public Class<?> getObjectType() {
        return UserDao.class;
    }

    // bean作用范围: 非单例
    public boolean isSingleton() {
        return false;
    }
}
